package Entidades;

import java.io.Serializable;
import java.sql.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="Receta")
public class Receta implements Serializable{
	private static final long serialUID=1L;
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column(nullable=false, name="idReceta")
	private int idReceta;
	
	@Temporal(TemporalType.DATE)
	@Column(nullable=false,name="fechUltVer")
	private Date fechUltVer;
	
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(nullable=false, name="idPlato")
	private Plato plato;
	
	@OneToMany(fetch=FetchType.EAGER)
	@JoinColumn(nullable=false, name="idItemRec")
	private List<itemReceta> itemRec;
	
	@OneToMany(fetch=FetchType.EAGER)
	@JoinColumn(nullable=false, name="idProd")
	private List<elaboracionVenta> elabVenta;
	
	@OneToMany(fetch=FetchType.EAGER)
	@JoinColumn(nullable=false, name="idProd")
	private List<elaboracionNoVenta> elabNoVenta;

	
}
